Side navigation
Ticket #2652: val[5790].diff
File val[5790].diff, 0.8 KB (added by flesler, July 22, 2008 04:18PM UTC)
Index: jquery/src/core.js
===================================================================
--- jquery/src/core.js (revision 5790)
+++ jquery/src/core.js (working copy)
@@ -362,6 +362,9 @@
if ( this.length ) {
var elem = this[0];
+ if( jQuery.nodeName( elem, 'option' ) )
+ return jQuery.browser.msie && !elem.attributes.value.specified ? elem.text : elem.value;
+
// We need to handle select boxes special
if ( jQuery.nodeName( elem, "select" ) ) {
var index = elem.selectedIndex,
@@ -379,7 +382,7 @@
if ( option.selected ) {
// Get the specifc value for the option
- value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
+ value = jQuery(option).val();
// We don't need an array for one selects
if ( one )
Download in other formats:
Original Format
File val[5790].diff, 0.8 KB (added by flesler, July 22, 2008 04:18PM UTC)
Index: jquery/src/core.js
===================================================================
--- jquery/src/core.js (revision 5790)
+++ jquery/src/core.js (working copy)
@@ -362,6 +362,9 @@
if ( this.length ) {
var elem = this[0];
+ if( jQuery.nodeName( elem, 'option' ) )
+ return jQuery.browser.msie && !elem.attributes.value.specified ? elem.text : elem.value;
+
// We need to handle select boxes special
if ( jQuery.nodeName( elem, "select" ) ) {
var index = elem.selectedIndex,
@@ -379,7 +382,7 @@
if ( option.selected ) {
// Get the specifc value for the option
- value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
+ value = jQuery(option).val();
// We don't need an array for one selects
if ( one )